import json
from app import BASE_DIR
def read_data_add():
    with open('../data/para.json') as f:
        data = json.load(f) # [[],[]] -->[(),()]在这里无所谓
        return data # 所以直接返回

def read_data_add2():
    # with open('../data/para2.json') as f:
    with open(BASE_DIR + '/Unittest/data/para2.json') as f:
        data_list = json.load(f) # [{},{}] -->[(),()]
        # 遍历
        new_data_list = []
        for data in data_list:
            # a = data.get("a")
            # b = data.get("b")
            # expect = data.get("expect")
            # new_data_list.append((a,b,expect))

            # 适用于数据全部需要保留
            new_data_list.append(tuple(data.values()))
        return new_data_list

if __name__ == '__main__':
    print(read_data_add2())